#######################################
######Masculinity Threat Analysis######
#######################################
###############10/10/25##################
#######################################

####Analysis Script for Gothreau & Haas, forthcoming in Journal of Experimental Political Science
####A Replication and Extension of Willer et al. (2013) Overdoing Gender: A Test of the Masculine Overcompensation Thesis 

library(haven)
library(ggplot2)
library(dplyr)
library(broom)
library(officer)
library(flextable)
library(forcats)
library(psych)
library(survey)
library(tidyr)
library(ggplot2)
library(patchwork)
library(table1)
library(xtable)


####Use Cleaning_Final.csv

setwd("C:/Users/f00825k/Dropbox/Masculinity Threat Replication/JEPS Submission/Conditional Acceptance/Analysis")
MTData <- read.csv("CleanMTData.csv")

MTData$GENDER <- factor(MTData$Q_CDGDRDESC_17)
MTData$RACETHNICITY <- factor(MTData$RACETHNICITY)
MTData$EDUC5 <- factor(MTData$EDUC5, ordered = TRUE)
MTData$PartyID5 <- factor(MTData$PartyID5)
MTData$INCOME4 <- factor(MTData$INCOME4)
MTData$REGION9 <- factor(MTData$REGION9)

DEMO <- table1(~ factor(GENDER) + AGE + factor(RACETHNICITY) + factor(EDUC5) + factor(PartyID5) + factor(INCOME4) + factor(REGION9), data=MTData)
print(DEMO)  
table <- as.data.frame(DEMO)








